// JavaScript Document
$(document).ready(function(){

			//$(".sub_menu").hide();
			var menuopen=0;
			var $select_menu=$(".sup_menu > .select_menu");
			var $select_menu1=$(".sup_menu > .select_menu > .sub_menu > li");
			//alert($select_menu1.length);
			if ($select_menu1.length>0){
			menuopen=$(".sup_menu > li").index($select_menu);
			supSelect($(".sup_menu > li:eq("+menuopen+")"));
			$(".sup_menu > li > a").click(function(){
				supSelect($(this).parent());
				});
			$(".sub_menu > li > a").click(function(){
				subSelect($(this).parent());
				});
			}else {
			supSelect($(".sup_menu > li:eq(0)"));
			$(".sup_menu > li > a").click(function(){
				supSelect($(this).parent());
				});
			$(".sub_menu > li > a").click(function(){
				subSelect($(this).parent());
				});
			}

			//						   subSelect($(".sub_menu > dt:eq(0)"));
			//							supSelect($(".sup_menu > li:eq(0)"));

});
//点击一级菜单
function supSelect($obj){
	var contentpath=$obj.find("a").attr("pos");
	if (contentpath!=null && contentpath!="" && contentpath!=undefined){
		$(window.parent.document).find('.right_frame iframe').attr("src",contentpath);
		$(".sub_menu > li").removeClass("select");
	}else{

		subSelect($obj.find(".sub_menu li:eq(0)"));
	}
	$(".sup_menu > li").find("> a").removeClass("select");
	$(".sub_menu").hide();
	$obj.find("> a").addClass("select");
	var $obj1=$obj.find(".sub_menu");
	$obj.find(".sub_menu").show();
}

function subSelect($sub_obj){
	var contentpath=$sub_obj.find("a").attr("pos");
	if (contentpath!=null && contentpath!="" && contentpath!=undefined){
		$(window.parent.document).find('.right_frame iframe').attr("src",contentpath);
	}
	$(".sub_menu > li").removeClass("select");
	$sub_obj.addClass("select");
}